<?php
// Copyright 2019 Hackware SpA <human@hackware.cl>
// This file is part of "Hackware Web Services Payment" and licensed under
// the terms of the GNU Affero General Public License version 3, or (at your
// option) a later version. You should have received a copy of this license
// along with the software. If not, see <https://www.gnu.org/licenses/>.

namespace Hawese\Payment\Policies;

use Hawese\Core\User;
use Hawese\Payment\Payment;

class PaymentPolicy
{
    /**
     * A user can only read its own payments.
     */
    public function read(User $user, Payment $payment): bool
    {
        return $payment->isOwner($user);
    }
}
